home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20021006-20030409
/
000267_tom.horsley@att.net_Fri Feb 7 15:06:09 EST 2003.msg
< prev
next >
Wrap
Text File
|
2020-01-01
|
3KB
|
82 lines
Article: 14061 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!panix!nycmny1-snh1.gtei.net!chcgil2-snh1.gtei.net!news.gtei.net!wn12feed!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail
Sender: tom@SPIKE
Newsgroups: comp.protocols.kermit.misc
Subject: input pattern matching blowing my mind...
From: tom.horsley@att.net (Thomas A. Horsley)
Message-ID: <uisvwssje.fsf@att.net>
Lines: 62
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
NNTP-Posting-Host: 8045abab4473203c19392f2a14c86b04
X-Complaints-To: abuse@worldnet.att.net
X-Trace: bgtnsc05-news.ops.worldnet.att.net 1044586885 8045abab4473203c19392f2a14c86b04 (Fri, 07 Feb 2003 03:01:25 GMT)
NNTP-Posting-Date: Fri, 07 Feb 2003 03:01:25 GMT
Organization: AT&T Worldnet
Date: Fri, 07 Feb 2003 03:01:25 GMT
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:14061
Running 2.1.3 k95 gui kermit on Windows XP.
Here is a fragment of a script I've been playing with to try and recognize
the sorts of passphrase prompts generated by openssh:
;
; Testing hacks...
;
output \13
input 10 \Fpattern({\10l*x>?})
if success {
output echo \39Saw prompt ---\v(inmatch)---\39\13
input 10 \Fpattern({\10l*x>?})
output sh ./booger\13
input 10 \Fpattern({nter?passphrase?for*:?})
; input 10 {\10Enter passphrase for}
if success {
output echo \39Saw message ---\v(inmatch)---\39\13
}
; output ssh-add\13
; input 10 \Fpattern({Enter?passphrase?for?*:?})
; if success {
; askq /GUI \%p \v(inmatch)
; output \%p\13
; }
}
connect
The first couple of patterns are just to see if pattern matching works at
all (it does, and I find inmatch set to the expected prompt string which on
the system I am connected to is actually "linux> ").
The "booger" shell script I invoke simply does an echo of an ssh prompt like
string so I can test without actually running ssh commands.
The next set of variously commented out stuff shows the pattern I finally
got to work. Note that the leading "E" in the "Enter" is left out of
the pattern.
Apparently I can't match an upper case E at the beginning of the pattern
come hell or high water :-).
I suspect something is going on with case twiddling, because when I try the
commented out variation without the pattern, the contents of inmatch which
echoes has a lower case "enter" at the beginning instead of "Enter" (the
string actually generated by the "booger" script).
Are there bugs here? Or am I just not aquainted with the devious
details of what is going on?
I tried [Ee] and ? in place of the leading E and neither one of
those variations worked. I can only get this to match when I
ignore the leading E completely (when using patterns).
P.S. In case it matters, the actual "booger" script looks like:
echo Enter passphrase for google google oogly woogly:
--
>>==>> The *Best* political site <URL:http://www.vote-smart.org/> >>==+
email: Tom.Horsley@worldnet.att.net icbm: Delray Beach, FL |
<URL:http://home.att.net/~Tom.Horsley> Free Software and Politics <<==+